package com.nowcoder.community.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import static com.nowcoder.community.util.Constants.SYSTEM_ID;

@EqualsAndHashCode(callSuper = true)
@Data
public class SystemMessage extends Message {
    public SystemMessage(int toUserId, String conversationId) {
        super.setFromId(SYSTEM_ID);
        super.setConversationId(conversationId);
        super.setToId(toUserId);
    }

    /**
     * 此方法在SystemMessage中无效
     */
    @Override
    public void setFromId(Integer fromId) {
    }

    /**
     * 此方法在SystemMessage中无效
     */
    @Override
    public void setConversationId(String conversationId) {
    }
}
